/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.hutech09.jsale.bsn;

import java.util.List;
import javax.ejb.Local;
import org.hutech09.jsale.bsn.exception.ItemExistsException;
import org.hutech09.jsale.bsn.exception.ItemNotFoundException;
import org.hutech09.jsale.entity.AccessGroup;
import org.hutech09.jsale.entity.AccessUser;

/**
 *
 * @author Nam
 */
@Local
public interface IAccessUserManager {

    public List<AccessUser> getAllUser();

    public List<AccessGroup> getAllGroup();

    public List<AccessGroup> getGroupUserIn(String userId) throws ItemNotFoundException;

    /**
     *
     * @param user
     * @return
     * @throws ItemExistsException
     */
    public AccessUser create(AccessUser user) throws ItemExistsException;

    /**
     *
     * @param userId
     * @return
     * @throws ItemNotFoundException
     */
    public AccessUser delete(String userId) throws ItemNotFoundException;

    public void addUserToGroup(String userId, String groupId) throws ItemNotFoundException;

    public void removeUserFormGroup(String userId, String groupId) throws ItemNotFoundException;

    public AccessUser update(AccessUser accessUser) throws ItemNotFoundException;

    AccessUser findById(String userId);
}
